<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>角色展示</title>
    <%--BootStrap美化页面--%>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

</head>
<body>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 colum">
            <div class="page-header">
                <h1>
                    <small>角色列表 ------- 显示所有角色</small>
                </h1>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4 column">

            <%--toAddUser--%>
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/role/toAddRole">新增角色</a>
        </div>

    </div>
</div>


<div class="row clearfix">
    <div class="col-md-12 column">
        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th>角色ID</th>
                <th>用户名称</th>
                <th>角色描述</th>
                <th>操作</th>
            </tr>
            </thead>

            <%--用户从数据库中查询出来，从list中遍历出来：foreach--%>
            <tbody>
                <c:forEach var="role" items="${allRole}">
                    <tr>
                        <td>${role.roleId}</td>
                        <td>${role.roleName}</td>
                        <td>${role.roleDesc}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/role/toUpdateRole?id=${role.roleId}">修改</a>
                            &nbsp; | &nbsp;
                            <a href="${pageContext.request.contextPath}/role/deleteRole/${role.roleId}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
    </div>
</div>


</body>
</html>
